home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java for 3D & VRML Worlds
/
Java for 3d and VRML Worlds.iso
/
world
/
shadow
/
shadow1.wrl
< prev
next >
Wrap
Text File
|
1996-10-17
|
4KB
|
195 lines
#VRML V2.0 utf8
#
# "Motion Shadow Effect"
# created by ask@krc.sony.co.jp (Masamichi zzzcat Asukai)
#
# Copyright(C) 1996 Sony Corporation. All rights reserved.
#
NavigationInfo {
headlight FALSE
}
Viewpoint {
position 0.0 1.75 30.0
}
Background {
skyColor 0.5 0.3 0.7
}
PROTO P_OBJECT [
exposedField SFVec3f translation 0 0 0
exposedField SFVec3f scale 1 1 1
exposedField SFRotation shadow_rotation 0 1 0 0
exposedField SFVec3f shadow_scale 1 1 1
exposedField SFFloat shadow_transparency 0
] {
Transform {
translation IS translation
scale IS scale
children [
# YOUR OBJECT DESCRIPTION (the height(Y) must be 1.0)
Billboard {
# "axisOfRotaion 0 1 0" doesn't work!
#axisOfRotaion 0 1 0
axisOfRotation 0 0 0
children [
Shape {
appearance Appearance {
texture ImageTexture {
url "tree.gif"
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-0.5 0 0,
0.5 0 0,
0.5 1 0,
-0.5 1 0,
]
}
coordIndex [
0, 1, 2, 3, -1,
]
}
}
]
}
# YOUR SHADOW DESCRIPTION (the height(Z) must be 1.0)
Transform {
rotation IS shadow_rotation
scale IS shadow_scale
children [
# YOUR SHADOW DESCRIPTION (the height(Z) must be 1.0)
Shape {
appearance Appearance {
material Material {
ambientIntensity 0
diffuseColor 0 0 0
transparency IS shadow_transparency
}
texture ImageTexture {
url "tree.gif"
}
textureTransform TextureTransform {
center 0.5 0.5
rotation 3.14
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-0.5 0 0,
0.5 0 0,
0.5 0 -1,
-0.5 0 -1,
]
}
coordIndex [
0, 1, 2, 3, -1,
]
}
}
]
}
]
}
}
PROTO P_LIGHT [
exposedField SFVec3f translation 0 0 0
]
{
Transform {
translation IS translation
children [
# YOUR LIGHT
PointLight {
intensity 1.0
}
Shape {
appearance Appearance {
material Material {
ambientIntensity 0
diffuseColor 0 0 0
emissiveColor 1 1 0
}
}
geometry Sphere{
radius 0.5
}
}
]
}
}
DEF TREE P_OBJECT {
translation 0 0 0
scale 3 3 3
}
DEF LIGHT P_LIGHT {}
DEF L_TIME TimeSensor{
cycleInterval 10.0
stopTime -1
loop TRUE
}
DEF POSINT PositionInterpolator{
set_fraction 0.5
key [0, 0.25, 0.5, 0.75, 1]
keyValue [-15 10 5, 5 15 5, 5 10 -15, -15 5 -15, -15 10 5]
}
ROUTE L_TIME.fraction_changed TO POSINT.set_fraction
#ROUTE POSINT.value_changed TO LIGHT.set_translation
ROUTE POSINT.value_changed TO LIGHT.translation
DEF TIME TimeSensor{
cycleInterval 0.2
stopTime -1
loop TRUE
}
DEF SCRIPT Script {
url "shadow1.class"
eventIn SFTime interval
field SFNode light USE LIGHT
field SFNode object USE TREE
field SFBool shadow_length TRUE
field SFBool shadow_depth TRUE
}
ROUTE TIME.cycleTime TO SCRIPT.interval
DEF GROUND Transform {
translation 0 -0.1 0
children[
Shape {
appearance Appearance {
material Material {
diffuseColor 0.6 0.4 0.4
emissiveColor 0.3 0.2 0.2
}
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-30 0 -30,
-30 0 30,
30 0 30,
30 0 -30,
]
}
coordIndex [
0, 1, 2, 3, -1,
]
}
}
]
}